ApplyFormPanel = function(){
	//items 团组类型
	var tasktypeinfo1 = {
        columnWidth:.3,
        bodyStyle: 'padding-right:5px;',
        layout: 'form',
        items: [
        	{
        		xtype:'fieldset',
	            title: '团组类型',
	            collapsible: true,
	            autoHeight:true,
	            defaults: {width: 210},
	            defaultType: 'textfield',
	            items :[{
	                    fieldLabel: '团组类别',
	                    name: 'taskbigtype',
	                    hiddenName:'taskbigtype',
	                    xtype:'combo',
	                    store:new Ext.data.JsonStore(
	                    	{
	                    		data:[
	                    			{value:'1',text:'考察与路演'},
	                    			{value:'2',text:'会议与展览'}
	                    		],
	                    		fields:['value','text']
	                    	}
	                    ),
	                    valueField: 'value',
						displayField: 'text',
	                    triggerAction: 'all',
					    lazyRender:true,
					    mode: 'local',
	                    editable:false
	                },{
	                    fieldLabel: '出访类型',
	                    name: 'tasksmalltype',
	                    hiddenName:'tasksmalltype',
	                    xtype:'combo',
	                    store:new Ext.data.JsonStore(
	                    	{
	                    		data:[
	                    			{value:'1',text:'考察'},
	                    			{value:'2',text:'路演'},
	                    			{value:'3',text:'会议'},
	                    			{value:'4',text:'展览'}
	                    		],
	                    		fields:['value','text']
	                    	}
	                    ),
	                    valueField: 'value',
						displayField: 'text',
	                    triggerAction: 'all',
					    lazyRender:true,
					    mode: 'local',
	                    editable:false
	                },{
	                    fieldLabel: '人数',
	                    xtype:'numberfield',
	                    name: 'personcount',
	                    value: ''
	                },{
	                	fieldLabel: '团长',
	                    name: 'leader',
	                    value: ''
	                },{
	                    fieldLabel: '组团单位',
	                    name: 'applycompany',
	                    value: ''
	                }
	            ]
        	}
        ]
    };
    window.selectCountry = function(){
    	
    };
    var store = new Ext.data.JsonStore(
    	{	
    		data:[],
    		autoLoad:true,
    		fields:['cname','cid']
    	}
    );
    //
    var cbocountry = new Ext.ux.form.SuperBoxSelect({
    		value:'1,0',
			editable :false,
		    allowBlank:false,
		    hideLabel: true,
		    xtype:'superboxselect',
		    fieldLabel: 'States',
		    emptyText:'请选择出访国家',
		    blankText:'必须选择出访国家',
		    resizable: true,
		    readOnly:true,
		    name: 'countryids',
		    hiddenName:'countryids',
		    width:400,
		    height:'auto',
		    anchor:'95%',
		    store: store,
		    mode: 'local',
		    displayField: 'cname',
		    displayFieldTpl: '{cname}',
		    valueField: 'cid',
		    forceSelection : true,
			allowQueryAll : false
    });
	//items 费用类型
    var tasktypeinfo2 = {
        columnWidth:.3,
        layout: 'form',
        items: [
        	{
        		xtype:'fieldset',
	            title: '出访国家或地区',
	            collapsible: true,
	            autoHeight:true,
	            //defaults: {width: 210},
	            //defaultType: 'textfield',
	            items :[
	            	{
	                	layout:'column',
	                	items:[
	                		{
	                			columnWidth:.7,
	                			layout:'form',
	                			labelWidth:30,
	                			items:[
	                				{
	                					xtype:'combo',
	                					name:'countrytype',
	                					hiddenName:'countrytype',
	                					anchor:'95%',
	                					typeAhead: true,
	                					fieldLabel:"类型",
									    triggerAction: 'all',
									    lazyRender:true,
									    mode: 'local',
									    store: new Ext.data.JsonStore({
									        fields: ['value','text'],
									        data: [
									        	{value:"0",text:"全部"},
									        	{value:"1",text:"出访国家或地区"},
									        	{value:"2",text:"赴台"},
									        	{value:"3",text:"赴港澳"},
									        	{value:"4",text:"赴港澳,台"},
									        	{value:"5",text:"出访国家或地区,赴港澳"},
									        	{value:"6",text:"出访国家或地区,赴台"},
									        	{value:"7",text:"出访国家或地区,赴港澳,赴台"}
									        ]
									    }),
									    valueField: 'value',
									    displayField: 'text'
	                				}
	                			]
	                		},{
	                			columnWidth:.3,
	                			layout:'form',
	                			items:[
	                				{
	                					xtype:'button',
	                					text:'选择国家或地区',
	                					handler:function(){
	                						var wincountry = new CountrySelectWindow();
	                						wincountry.show();
	                						wincountry.on('submit',
	                							function(wincountry,countrys,cids){
	                								var _store = cbocountry.getStore();
										       			_store.loadData(countrys);
										       			cbocountry.setValue(cids.join(','));
										       			wincountry.close();
										       			
	                								/*console.log(countrys);
	                								console.log(cids);*/
	                							}
	                						);
	                					}
	                				}
	                			]
	                		}]
	                },
	                cbocountry
	            ]
        	}
        ]
    };
	//items 出访国家
    var tasktypeinfo3 = {
        columnWidth:.3,
        layout: 'form',
        bodyStyle: 'padding-left:5px;',
        items: [
        	{
        		xtype:'fieldset',
	            title: '出访时间与类别',
	            collapsible: true,
	            autoHeight:true,
	            defaults: {width: 210},
	            defaultType: 'textfield',
	            items :[{
	            		xtype:'combo',
	                    fieldLabel: '出访类别',
	                    name: 'goboardtype',
	                    hiddenName:'goboardtype',
	                    store:new Ext.data.JsonStore({
	                    	data:[
	                    		{text:'一次出访',value:'1'},
	                    		{text:'一年多次',value:'2'},
	                    		{text:'长期出访',value:'3'}
	                    	],
	                    	fields:['text','value']
	                    }),
	                    anchor:'95%',
	                    displayField:'text',
	                    valueField:'value',
	                    editable:true,
	                    typeAhead: true,
	                    mode:'local',
	                    triggerAction:'all'
	                },{
	                	fieldLabel:'出访日期',
	                	anchor:'95%',
	                	xtype:'datefield',
	                	name:'startdate',
	                	value:new Date(),
	                	format:'Y-m-d'
	                },{
	                	fieldLabel:'回国日期',
	                	anchor:'95%',
	                	xtype:'datefield',
	                	name:'enddate',
	                	value:new Date(),
	                	format:'Y-m-d'
	                }
	            ]
        	}
        ]
    };
	//items 出访类型
    var tasktypeinfo4 = {
        columnWidth:.3,
        layout: 'form',
        bodyStyle: 'padding-right:5px;',
        items: [
        	{
        		xtype:'fieldset',
	            title: '付款类型',
	            collapsible: true,
	            autoHeight:true,
	            defaults: {width: 210},
	            defaultType: 'textfield',
	            items :[{
	                    fieldLabel: '付款类型',
	                    name: 'feetype',
	                    hiddenName:'feetype',
	                    xtype:'combo',
	                    store:new Ext.data.JsonStore(
	                    	{
	                    		data:[
	                    			{value:'1',text:'组团单位付费'},
	                    			{value:'2',text:'参团单位付费'},
	                    			{value:'3',text:'组团与参团单位付费'},
	                    			{value:'4',text:'邀请单位付费'}
	                    		],
	                    		fields:['value','text']
	                    	}
	                    ),
	                    valueField: 'value',
						displayField: 'text',
	                    triggerAction: 'all',
					    lazyRender:true,
					    mode: 'local',
	                    editable:false
	                }
	            ]
        	}
        ]
    };
	//items 付款类型
    var tasktypeinfo5 = {
        columnWidth:.3,
        layout: 'form',
        items: [
        	{
        		xtype:'fieldset',
	            title: '文件信息',
	            collapsible: true,
	            autoHeight:true,
	            defaults: {width: 210},
	            defaultType: 'textfield',
	            items :[
	            	{
	                    fieldLabel: '任务批件号',
	                    name: 'applytaskdocno',
	                    value: ''
	                },{
	                    fieldLabel: '政审批件号',
	                    name: 'applypersondocno',
	                    value:''
	                },{
	                    fieldLabel: '申报人姓名',
	                    name: 'applyusername',
	                    value:''
	                },{
	                    fieldLabel: '申报人电话',
	                    name: 'applyuserphone'
	                },{
	                	fieldLabel:'是否加急',
	                	xtype:'combo',
	                	name:'ishurry',
	                	hiddenName:'ishurry',
	                	store:new Ext.data.JsonStore(
	                		{
	                			data:[
	                				{text:'是',value:'1'},
	                				{text:'否',value:'0'}
	                			],
	                			fields:['text','value']
	                		}
	                	),
	                	triggerAction:'all',
	                	editable:false,
	                	mode:'local',
	                	displayField:'text',
	                	valueField:'value'
	                }
	            ]
        	}
        ]
    };
	//items 附件类型
    var tasktypeinfo6 = {
        columnWidth:.3,
        layout: 'form',
        bodyStyle: 'padding-left:5px;',
        items: [
        	{
        		xtype:'fieldset',
	            title: '备注信息',
	            collapsible: true,
	            autoHeight:true,
	            defaults: {width: 320},
	            defaultType: 'textarea',
	            items :[{
	                    fieldLabel: '备注信息',
	                    hideLabel:true,
	                    name: 'note',
	                    value: ''
	                }
	            ]
        	}
        ]
    };
    //items 人员信息
    var tasktypeinfo7 = {
        columnWidth:.3,
        layout: 'form',
        bodyStyle: 'padding-left:5px;',
        items: [
        	{
        		xtype:'fieldset',
	            title: '单位信息',
	            collapsible: true,
	            autoHeight:true,
	            defaults: {width:210},
	            defaultType: 'textfield',
	            items :[{
	                    fieldLabel: '组团单位',
	                    name: 'applycompany',
	                    value: ''
	                },{
	                    fieldLabel: '人数',
	                    xtype:'numberfield',
	                    name: 'personcount',
	                    value: ''
	                },{
	                	fieldLabel: '团长',
	                    name: 'leader',
	                    value: ''
	                }
	            ]
        	}
        ]
    };
    var tasktypeinfo8 = {
        columnWidth:.3,
        layout: 'form',
        bodyStyle: 'padding-left:5px;',
        items: [
        	{
        		
        	}
        ]
    };
     var tasktypeinfo9 = {
        columnWidth:.3,
        layout: 'form',
        bodyStyle: 'padding-left:5px;',
        items: [
        	{
        		
        	}
        ]
    };
    //关闭当前界面，跳转到列表界面
  	var goToList = function(applyform){
  		applyform.ownerCt.removeAll(true);
		var b=new ApplyFMSGridPanel();
		Ext.getCmp('ApplyFMSPanel').add(b);
		Ext.getCmp('ApplyFMSPanel').doLayout();
  	}
	var form = new Ext.form.FormPanel(
		{
			bodyStyle: 'padding-left:5px;padding-top:5px;',
			frame:true,
			autoScroll : true,
			autoWidth : true,
			items:[
				{
					layout:'column',
					items:[tasktypeinfo1,tasktypeinfo2,tasktypeinfo3]
				},{
					layout:'column',
					items:[tasktypeinfo4,tasktypeinfo5,tasktypeinfo6]
				}
			],
			buttons:[
				{
					text:"附件上传",
					handler:function(){
						
					}
				},
				{
					text:"确定",
					handler:function(){
						var _form = form.getForm();
						alert(347);
						_form.submit(
							{
								url:__ctxPath+'/back/taskinfo/applyfms.html',
								params:{flag:0},
								method:'POST',
								success:function(form,action){
									alert('success');
								},
								failure:function(form,action){
									alert('failure');
									//goToList(this);
								}
							}
						);
						
					},
					scope:this
				},
				{
					text:"取消",
					handler:function(){
						goToList();
					},
					scope:this
				}
			]
		}
	);
	var config = {
		title:'出国申报',
		iconCls:'zoom',
		layout:"form",
//		width:300,
		autoWidth:true,
//		autoHeight:true,
		height:400,
		items:[form]
	}
	ApplyFormPanel.superclass.constructor.call(this,config);
}
Ext.extend(ApplyFormPanel,Ext.Panel);